package com.example.piece.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.example.piece.R
import com.example.piece.databinding.ItemHomeSearchHistoryBinding
import com.example.piece.BR

class HomeSearchHistoryAdapter(data: List<String>) :
    BaseQuickAdapter<String, BaseDataBindingHolder<ItemHomeSearchHistoryBinding>>(
        R.layout.item_home_search_history
    ) {


    override fun convert(holder: BaseDataBindingHolder<ItemHomeSearchHistoryBinding>, item: String) {
        val binding =
            holder.dataBinding
        val variable = binding?.setVariable(BR.entity, item)
        binding?.setVariable(BR.adapter, this)
        binding?.setVariable(BR.position, holder.layoutPosition)

        binding?.executePendingBindings()
    }
}